package com.test.demo.main.adapter;

import android.content.Context;
import android.view.View;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.test.demo.R;
import com.test.demo.bean.LikeBean;
import com.test.demo.bean.RepostBean;

import java.util.ArrayList;


public class LikeAdapter extends BaseQuickAdapter<LikeBean, BaseViewHolder> {

    ArrayList<LikeBean> datas = new ArrayList<>();

    public LikeAdapter(ArrayList<LikeBean> data) {
        super(R.layout.adapter_like_item, data);
    }

    public void setData(ArrayList<LikeBean> datas) {
        this.datas = datas;
    }


    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, LikeBean LikeBean) {
        baseViewHolder.setText(R.id.tv_time_ago, LikeBean.time);
        if (LikeBean.headId != 0){
            baseViewHolder.setImageResource(R.id.profile_img,LikeBean.headId);
        }
        if (LikeBean.circleId != 0) {
            baseViewHolder.setImageResource(R.id.profile_circle, LikeBean.circleId);
        }
        if (LikeBean.sexId != 0) {
            baseViewHolder.setImageResource(R.id.profile_sex, LikeBean.sexId);
        }

        if (LikeBean.level ==1){
            baseViewHolder.setVisible(R.id.ll_level, true);
        }else {
            baseViewHolder.setGone(R.id.ll_level, true);
        }
    }
}

